package com.bayihouse.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bayihouse.model.excel.publicClass.BaseOneEntity;
import com.bayihouse.model.excel.publicClass.father.BaseEntity;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName unit
 */
@TableName(value ="unit")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@EqualsAndHashCode
public class Unit extends BaseOneEntity<Room> implements Serializable {


    /**
     * 
     */
    @TableField("father_id")
    private Long houseId;

    private String detail;

    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public void setTId() {
        if (super.checkIsEmptyTList()) {
            return;
        }
        super.tlist.stream().forEach(child->{
            child.setUnitId(super.id);
        });
    }
}